<%--
  Created by IntelliJ IDEA.
  User: liuxin
  Date: 2022/7/14
  Time: 16:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form action="/captcha/test01" method="post">
    <img src="${pageContext.request.contextPath}/captcha" id="cap" style="width: 100px" onclick="refresh()">
    <input type="text" name="captcha"/><br/>
    <input type="submit" value="提交"/>
</form>


<script type="text/javascript">
    function refresh() {
        var img=document.getElementById("cap");
        img.src="${pageContext.request.contextPath}/captcha?"+new Date().getTime();
    }
</script>
</body>
</html>